﻿using System;
using Game1942.Library.Background;
using Game1942.Library.Background.Bodies;
using Game1942.Library.FlightPlans;
using Game1942.Library.Weapons;

namespace Game1942.Library.Planes
{
    public class Plane : Aircraft
    {
        public Plane()
        {
            energy = new EnergyCounter(Constants.Plane.Energy);
            damage = Constants.Plane.Damage;
            score = Constants.Plane.Score;
            manageTurn = new TurnManager(Constants.Plane.Speed, Constants.Plane.Rate);
            playerTeam = Constants.Plane.PlayerTeam;

            flightPlan = new RoundTripStrategy(Constants.Plane.Speed,Background.Background.Instance.GetDimension().Y / 2);//Baja hasta la mitad del mapa
            
            position.SetBody(new Square(Constants.Plane.Width, Constants.Plane.Height));
        }

        public Plane(Point value): this()
        {
            base.SetPosition(value);
        }

        public override void Shoot()
        {
            var laser = new Laser(new Point(ActualPosition.X + 30,ActualPosition.Y + 90),playerTeam);
            Driver.Instance.AddLiveUnit(laser, Constants.Laser.Width, Constants.Laser.Height,Constants.Laser.ViewNameDown);
        }
    }
}
